<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<div class="app">
    <section class="layout">
        <section class="main-content col-lg-12" id="operationLeftDiv">
            <div class="content-wrap">
                <div class="wrapper" style="bottom: 50px;">
                    <ul class="nav nav-tabs">
                        <li>
                            <a href="#">手术安排列表</a>
                        </li>
                    </ul>
                    <section class="panel panel-default">
                        <div class="panel-body">
                            <div class="form-group">
                                <form:form id="searchForm" modelAttribute="operationSchedule"
                                           onsubmit="return loadDivForm('mainCenterDiv','searchForm','${ctx}/operation/operationSchedule/check');"
                                           method="post" class="form-inline">
                                    <input name="pageNo" id="pageNo" type="hidden" value="${page.pageNo}"/>
                                    <input name="pageSize" id="pageSize" type="hidden" value="${page.pageSize}"/>
                                    <label>手术日期:&nbsp;&nbsp;</label>
                                    <fmt:formatDate value="${operationSchedule.scheduledDate}"
                                                    pattern="yyyy-MM-dd HH:mm:ss" var="date"/>
                                    <input name="scheduledDate" id="scheduledDate" htmlEscape="false" class="form-control Wdate"
                                           data-parsley-required="true" readonly
                                           onfocus="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})"
                                           value="${date}"/>
                                    <label>开单科室:&nbsp;&nbsp;</label>
                                    <sys:treeselect selectedParent="true" id="orgDeptId" name="operationDeptId" value="${operationSchedule.operationDeptId}"  update="${not empty orgDept.id}" labelName="${operationSchedule.operationName}" labelValue="${operationSchedule.operationName}"
                                                    title="科室" url="/sys/orgDept/treeData" extId="${orgDept.id}" cssClass="form-control" isnull="true"/>
                                    <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                                    <input id="btnPrint" class="btn btn-primary" type="submit" value="打印单据" />
                                </form:form>
                            </div>
                            <div class="table-responsive no-border" id="contentDiv">
                                <table class="table table-bordered table-striped mg-t datatable" id="contentTable">
                                    <thead>
                                    <tr>
                                        <th>病人名字</th>
                                        <th>手术时间</th>
                                        <th>手术室</th>
                                        <th>手术间</th>
                                        <th>隔离等级</th>
                                        <th>麻醉方法</th>
                                        <th>门诊/住院</th>
                                        <th>手术状态</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${schedulePage.list}" var="operationSchedule">
                                        <tr>
                                            <td>${operationSchedule.patientName}</td>
                                            <td><fmt:formatDate value="${operationSchedule.scheduledDate}" pattern="yyyy-MM-dd HH:mm:ss"></fmt:formatDate></td>
                                            <td>${operationSchedule.operatingRoomName}</td>
                                            <td>${operationSchedule.operatingNoName}</td>
                                            <td>${fns:getDictLabels(operationSchedule.isolationIndicator, 'QUARANTINE_MARK', '')}</td>
                                            <td>${fns:getDictLabels(operationSchedule.anesthesiaMethod, 'ANESTHESIA_METHOD', '')}</td>
                                            <td>
                                                <c:if test="${operationSchedule.inoroutFlag=='0'}">门诊</c:if>
                                                <c:if test="${operationSchedule.inoroutFlag=='1'}">住院</c:if>
                                            </td>
                                            <td>
                                                <c:if test="${operationSchedule.operStatus=='1'}">
                                                    手术安排
                                                </c:if>
                                                <c:if test="${operationSchedule.operStatus=='2'}">
                                                    手术安排确认
                                                </c:if>
                                            </td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </section>
                </div>
            </div>
        </section>
        <script>
            $(function(){
                $("#btnPrint").click(function(){
                    var scheduledDate=$("#scheduledDate").val();
                    var orgDeptId=$("#orgDeptId").val();
                    printPdf('${ctx}/operation/operationScheduleAudit/operationSchedulePrint?scheduledDate='+scheduledDate+'&orgDeptId='+orgDeptId);
                })
            })
        </script>
</div>
